
<!DOCTYPE html>
<html lang="en">
<script type="text/javascript" src="https://code.jquery.com/jquery-1.9.0.js"></script>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>{{ title }}</title>
</head>
<body>
<h2 style="margin-left: 20px">{{ title }}</h2>
<!--<form action="/dashboard/edit_remain_duration" method="post" accept-charset="utf-8">-->
    <ul class="clearfix unstyled inline form-inline">
        <li style="margin-top: 10px">
            <label   style="margin-left: 12px">账号ID：</label>
            <input name="user_id" type="text" id="userId" value=""  style="margin-right: 25px">
        </li>
        <li style="margin-top: 10px">
            <label  style="margin-left: 12px">剩余时长（分钟）：</label>
            <input name="remain_duration" type="text" id="remainTime" value=""  style="margin-right: 25px">
        </li>
    </ul>
        <input class="btn" type="submit" style="margin-left: 200px" value="提交">
<!--</form>-->
</body>
</html>
<script type="text/javascript" >
    $(".btn").click(function () {
        user_id = $("input[ name='user_id' ]").val()
        remain_duration = $("input[ name='remain_duration' ]").val()
        send_data = {remain_duration, user_id};
        $.ajax({
            url: '/dashboard/edit_remain_duration',
            type: 'POST',
            data: send_data,
            cache: false,
            success: function (data) {
                alert(data)
            }
        });
    });

</script>
<style>
    input[type=submit] {
        border-radius: 5px;
        border: 0;
        width: 80px;
        height:25px;
        font-family: Tahoma;
        background: #f4f4f4;
        /* Old browsers */
        background: -moz-linear-gradient(top, #f4f4f4 1%, #ededed 100%);
        /* FF3.6+ */
        background: -webkit-gradient(linear, left top, left bottom, color-stop(1%, #f4f4f4), color-stop(100%, #ededed));
        /* Chrome,Safari4+ */
        background: -webkit-linear-gradient(top, #f4f4f4 1%, #ededed 100%);
        /* Chrome10+,Safari5.1+ */
        background: -o-linear-gradient(top, #f4f4f4 1%, #ededed 100%);
        /* Opera 11.10+ */
        background: -ms-linear-gradient(top, #f4f4f4 1%, #ededed 100%);
        /* IE10+ */
        background: linear-gradient(to bottom, #f4f4f4 1%, #ededed 100%);
        /* W3C */
        filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f4f4f4', endColorstr='#ededed', GradientType=0);
        /* IE6-9 */
    }
</style>